home *** CD-ROM | disk | FTP | other *** search
- 10 rem*********************************
- 20 rem* *
- 30 rem* demo program for hires *
- 40 rem* routines *
- 50 rem* *
- 60 rem*********************************
- 70 rem
- 80 rem
- 90 if a=0then a=1:load "hires.mc",8,1
- 100 ad=49152
- 110 sh=ad:rem set up hires
- 120 tx=ad+3:rem text restore
- 130 ch=ad+6:rem clear screen
- 140 cc=ad+9:rem clear colour
- 150 ph=ad+12:rem plot hires
- 160 pc=ad+15:rem plot colour
- 170 pb=ad+18:rem plot both
- 172 ld=ad+21:rem plot line
- 174 hl=ad+24:rem horiz line
- 176 vl=ad+27:rem vert line
- 178 db=ad+30:rem box draw
- 180 xl=251:rem x low
- 190 xh=252:rem x high
- 200 yl=253:rem y coord
- 202 x1=14:rem end x low
- 204 x2=15:rem end x high
- 206 y1=255:rem end y
- 210 cb=2:rem colour byte
- 220 px=254:rem plot indicator
- 230 rem
- 240 rem menu
- 250 rem
- 260 print "[147]"
- 270 print "[158] line drawing demo"
- 280 print:print tab(10);"1. random lines"
- 290 print:print tab(10);"2. random boxes"
- 300 print:print tab(10);"3. both together"
- 310 print:print tab(10);"[158]enter option"
- 312 print:print "note: this program is only intended"
- 314 print "as an illustration. it may crash"
- 316 print "occasionally as the hi-res routines"
- 318 print "use some of the same locations as basic":print
- 320 get i$:if i$="" then 320
- 330 if i$>"3" or i$<"1" then 320
- 331 i=val(i$)
- 340 on i gosub 1000,2000,3000
- 360 sys tx:goto 260
- 900 rem
- 910 remrandom lines
- 920 rem
- 1000 poke px,255:sys sh
- 1010 gosub 5000:sys ld
- 1020 get i$:if i$="" then 1010
- 1030 return
- 1900 rem
- 1910 rem random boxes
- 1920 rem
- 2000 poke px,255:poke cb,67:sys sh
- 2010 gosub 5000:sys db
- 2020 get i$:if i$="" then 2010
- 2030 return
- 2090 rem
- 2100 rem do both
- 2110 rem
- 3000 poke px,255:poke cb,67:sys sh
- 3010 gosub 5000:sys ld:gosub 5000:sys db
- 3020 get i$:if i$="" then 3010
- 3030 return
- 4900 rem
- 4910 rem set up coords
- 4920 rem
- 5000 poke px,255:x=int(rnd(1)*319)
- 5010 poke xl,x-int(x/256)*256:poke xh,int(x/256)
- 5020 x=int(rnd(1)*319)
- 5030 poke x1,x-int(x/256)*256:poke x2,int(x/256)
- 5040 poke yl,int(rnd(1)*199):poke y1,int(rnd(1)*199)
- 5050 return
-